package handler

import (
	"HermesLinkGo/models"
	"HermesLinkGo/models/common"
	"github.com/gin-gonic/gin"
)

type WalletInfo struct {
	TotalValue     int `json:"totalValue"`
	AvailableValue int `json:"availableValue"`
}

func GetMemberInfo(c *gin.Context) {
	currentUserId := c.GetString("current_user_id")
	userinfo, err := models.GetUserByUid(currentUserId)
	if err != nil {
		c.JSON(200, common.NewFailCommonResponse(err.Error()))
	} else {
		c.JSON(200, common.NewSuccessCommonResponseWithData(MemberInfo{
			Nickname: userinfo.Nickname,
			Username: userinfo.Username,
			Avatar:   userinfo.Avatar,
		}))
	}
}

type MemberInfo struct {
	Nickname string `json:"nickname"`
	Username string `json:"username"`
	Avatar   string `json:"avatar"`
}
